import 'package:flutter/material.dart';

class SearchBar extends StatefulWidget {
  final String logo;
  final String getLocation;
  final bool currentWeather;
  final Function goBackCallback;
  final String inputValue;
  final Function onCancel;
  final Function onSearch;
  // final ValueChanged<String> onSearchSubmit;

  const SearchBar({
    Key? key,
    required this.logo,
    required this.getLocation,
    required this.goBackCallback,
    required this.inputValue,
    required this.onCancel,
    required this.onSearch,
    required this.currentWeather,
    // required this.onSearchSubmit
  }) : super(key: key);
  // SearchBar({Key? key}) : super(key: key);

  @override
  _SearchBarState createState() => _SearchBarState();
}

class _SearchBarState extends State<SearchBar> {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.center,
        children: <Widget>[
          Container(
            margin: EdgeInsets.only(top: 13.0),
            child: Row(
              children: <Widget>[
                Image.asset(
                  'image/logo.png',
                  width: 20.0,
                  height: 20.0,
                ),
                Padding(
                  padding: const EdgeInsets.only(right: 5.0),
                ),
                Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: <Widget>[
                    Row(
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: <Widget>[
                        Text(
                          widget.getLocation,
                          style: TextStyle(fontSize: 17.0),
                        ),
                        Padding(padding: const EdgeInsets.only(left: 5.0)),
                        Image.asset('image/backbtn.png'),
                      ],
                    ),
                    Row(
                      children: <Widget>[
                        Icon(
                          Icons.ac_unit,
                          size: 13.0,
                        ),
                        Padding(
                          padding: EdgeInsets.only(left: 3.0),
                        ),
                        Text('暴雪-5-8摄氏度', style: TextStyle(fontSize: 12.0))
                      ],
                    )
                  ],
                )
              ],
            ),
          ),
          Expanded(child: Text('')),
          Container(
              margin: EdgeInsets.only(top: 15.0),
              child: Row(
                children: <Widget>[
                  Column(
                    children: <Widget>[
                      Image.asset('image/scancode.png'),
                      Padding(padding: EdgeInsets.only(top: 5.0)),
                      Text('扫一扫', style: TextStyle(fontSize: 12.0)),
                    ],
                  ),
                  Padding(padding: const EdgeInsets.only(right: 10.0)),
                  Column(
                    children: <Widget>[
                      Image.asset('image/hexiaocode.png'),
                      Padding(padding: EdgeInsets.only(top: 5.0)),
                      Text('支付核销', style: TextStyle(fontSize: 12.0))
                    ],
                  ),
                  Padding(padding: const EdgeInsets.only(right: 10.0)),
                  Column(
                    children: <Widget>[
                      Image.asset('image/money.png'),
                      Padding(padding: EdgeInsets.only(top: 5.0)),
                      Text('抢红包', style: TextStyle(fontSize: 12.0))
                    ],
                  )
                ],
              ))
        ],
      ),
    );
  }
}
